package com.bit.mybatis.demo.mapper;

import com.bit.mybatis.demo.model.UserInfo;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserInfoMapper {

    @ResultMap(value = "BaseMap")
    @Select("SELECT * FROM `user_info`")
    List<UserInfo> selectList();


    @Select("SELECT id,  username,  `password`,  age,  gender,  phone,  " +
            "delete_flag AS deleteFlag,  create_time AS createTime," +
            "update_time AS updateTime FROM `user_info`")
    List<UserInfo> selectList2();


    @Results(id = "BaseMap", value = {
            @Result(column = "delete_flag", property = "deleteFlag"),
            @Result(column = "create_time", property = "createTime"),
            @Result(column = "update_time", property = "updateTime"),
    })
    @Select("SELECT * FROM `user_info`")
    List<UserInfo> selectList3();


    @Select("SELECT * FROM `user_info`")
    List<UserInfo> selectList4();


}
